<div >
    <div class="panel panel-default corner-radius achive-articles">
        <div class="panel-heading text-center">
        <h3 class="panel-title">文章归档</h3>
        </div>
        <div class="panel-body">
            <?php
                if(count($articleArchieve)<=5)
                {
                    $articleArchieve5 = $articleArchieve;
                    $articleArchieveAll = $articleArchieve;
                }
                else
                {
                    $articleArchieve5 = $articleArchieve->slice(0,5);
                    $articleArchieveAll = $articleArchieve;
                }
            ?>
            <ul class="list articleArchieve5">
                @foreach($articleArchieve5 as $key => $archieve)
                    <li>
                        <a class="archieve_route" style="display:inline-block;width:100%;" href="{{route('blogs.archieve', ['name' => $blog->slug, 'article_ids' => $archieve->article_ids])}}">
                            <span  class="lf">{{date('Y 年 m 月', strtotime($archieve->archieved_at))}}</span>
                            <span class="rt" >{{$archieve->article_count}} 篇</span>
                        </a>
                    </li>
                @endforeach
            </ul> 
            <ul class="list articleArchieveAll" style="display:none;">
                @foreach($articleArchieveAll as $key => $archieve)
                    <li>
                        <a class="archieve_route" style="display:inline-block;width:100%;" href="{{route('blogs.archieve', ['name' => $blog->slug, 'article_ids' => $archieve->article_ids])}}">
                            <span class="lf">{{date('Y 年 m 月', strtotime($archieve->archieved_at))}}</span>
                            <span class="rt" >{{$archieve->article_count}} 篇</span>
                        </a>
                    </li>
                @endforeach
            </ul> 
        </div>
        @if(count($articleArchieveAll)>5)
            <a><p class="text-center double-down" ><i class="fa fa-angle-double-down fa-lg" aria-hidden="true"></i> <span class="stat">展开</span></p></a>
        @endif
    </div>
</div>
@section('scripts')
<script>
    $('.double-down').click(function(){
        $('.articleArchieve5').hide()
        $('.articleArchieveAll').show()
        $('.double-down').hide()
    })
</script>
@stop
